package com.qihunet.springbootjwt.service.impl;

import com.qihunet.springbootjwt.persistent.entity.UserInfo;
import com.qihunet.springbootjwt.service.UserInfoService;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author gary
 */
@Service
public class UserInfoServiceImpl implements UserInfoService {
    @Override
    public UserInfo findByUsername(String username) {
        UserInfo userInfo = new UserInfo();
        userInfo.setId(1L);
        userInfo.setDisplayUserId("M0001");
        userInfo.setUsername("gary");
        userInfo.setIsEnabled(true);
        userInfo.setUserType(1);
        return userInfo;
    }

    @Override
    public List<String> findUserPermissionByUserIdAndUserType(UserInfo userInfo) {
        return Collections.singletonList("ROLE_ADMIN");
    }
}
